var ctx=window.daijia.ctx;
var orderid=window.daijia.orderid;
var thisButton;

function paidanDriver(){
	$.post(ctx+'/order/paidan',{'driverid':thisButton.attr("data-value"),'orderid':orderid},function(data){
        if(data.success){
            $.scojs_message('派单成功', $.scojs_message.TYPE_OK);
            window.location.href=ctx+"/order/list";
        } else {
            $.scojs_message(data.message, $.scojs_message.TYPE_ERROR);
        }
	},'json');
}

$(function () {
	$(".paidanthis").click(function(){
        thisButton = $(this);
        var confirm = $.scojs_confirm({
          content: "确定要派单给该服务人员吗？",
          action:paidanDriver
        });
        confirm.show();
	});
});

